﻿<%@ Page Title="" Language="C#" MasterPageFile="../Shared/Store.Master" Inherits="System.Web.Mvc.ViewPage<Fashion.ViewModels.StoreIndexViewModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Browse
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="leftnav">
        <ul>
            <% foreach (var category in Model.Categories)
               { %>
            <li>
                <%: Html.ActionLink(category, "Browse", new {category = category}) %>
            </li>
            <% } %>
        </ul>
    </div>
 
 <p>Total Products: <strong><%= ViewData["totalProducts"] %></strong></p>
   <% if ((int)ViewData["totalProducts"] == 0)
       { %>
        <p>Sorry! No Product Found.</p>
    <% }
       else
       { %>    
    
        <div class="viewitems">
            <% foreach (var product in Model.Products)
               { %>
            <div class="viewitem">
                <img src="../../../../Content/<%: product.ImageList %>" alt="<%: product.ProductName %>" width="85" height="140" />
                <p>
                <%: product.ProductName %>
                     <span>$
                        <%: product.Price %> </span><%: Html.ActionLink("Details", "Product", new {pid = product.ProductID } ) %>
                </p>
            </div>
        <% } %>
        
        <br />
        <% if ((string)ViewData["pageLinks"] != "")
           { %>
           <%= ViewData["pageLinks"] %>
           <br /><br />
        <% } %>       
    <% } %>
    </div>

</asp:Content>
